{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1b797937-2ac8-475d-8006-f80e5be4656d",
   "metadata": {},
   "source": [
    "Chapter 03\n",
    "# LaTeX公式\n",
    "Book_1《编程不难》 | 鸢尾花书：从加减乘除到机器学习  "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dbfaf60d-88c9-4d00-928b-20cf61550ac7",
   "metadata": {},
   "source": [
    "$$A_{m\\times n} = \n",
    " \\begin{bmatrix}\n",
    "  a_{1,1} & a_{1,2} & \\cdots & a_{1,n} \\\\\n",
    "  a_{2,1} & a_{2,2} & \\cdots & a_{2,n} \\\\\n",
    "  \\vdots  & \\vdots  & \\ddots & \\vdots  \\\\\n",
    "  a_{m,1} & a_{m,2} & \\cdots & a_{m,n} \n",
    " \\end{bmatrix}$$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "64e77bad-b0e7-4b30-a5f8-1f6cf4ac4c56",
   "metadata": {},
   "source": [
    "$$f_X(x)={\\frac {1}{\\sigma {\\sqrt {2\\pi }}}}\n",
    "\\exp \\left({-{\\frac {1}{2}}\n",
    "\\left({\\frac {x-\\mu }{\\sigma}}\\right)^{2}}\\right)$$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b08c7431-05aa-4259-accd-eaee77016ae2",
   "metadata": {},
   "source": [
    "$ {AaBbCc} $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7f2e21a2-1038-4f2a-8b70-b26162a6ca06",
   "metadata": {},
   "source": [
    "$ \\mathrm {AaBbCc} $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7d9b740e-55fb-4896-80e0-805b7ccf5ee1",
   "metadata": {},
   "source": [
    "$ \\mathbf {AaBbCc} $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c1c82f6-2f7e-4786-a6e2-f4541927ef07",
   "metadata": {},
   "source": [
    "$ \\boldsymbol {AaBbCc} $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dcd39abb-5feb-41a3-bd04-e3d031e56f26",
   "metadata": {},
   "source": [
    "$ \\mathtt {AaBbCc} $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "349a43a6-8d94-443b-890a-982f498a631f",
   "metadata": {},
   "source": [
    "$ \\mathcal {ABCDEF} $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "704f8ed1-31fb-459c-b4e6-bf62b6d8b0a1",
   "metadata": {},
   "source": [
    "$ \\mathbb {CRQZN} $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fed7b180-3d9c-424f-a3be-d68fa9c20413",
   "metadata": {},
   "source": [
    "$\\text {Aa Bb Cc}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7f364c95-7ae6-4d2a-8904-3fedca2b99b9",
   "metadata": {},
   "source": [
    "$\\mathrm{d}x$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2487c36f-ea37-4945-9ad0-6dee08276b69",
   "metadata": {},
   "source": [
    "$\\operatorname{T}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "aa455ec0-22ac-4b8b-9ebb-982d9582f60f",
   "metadata": {},
   "source": [
    "$x'$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "060da429-6f33-4ae4-99fa-3cec7976fe8c",
   "metadata": {},
   "source": [
    "$x^{\\prime}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "567d8f2e-f8eb-48b6-a6b2-9fa9fa40c077",
   "metadata": {},
   "source": [
    "$x'’$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5af0265d-df2e-4463-bada-d210139256c9",
   "metadata": {},
   "source": [
    "$\\overrightarrow{AB}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "421ce285-f729-402c-a54b-fc58778a96cf",
   "metadata": {},
   "source": [
    "$\\underline{x}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e8161919-2159-493d-8fbf-08be4a5db788",
   "metadata": {},
   "source": [
    "$\\hat{x}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9790c000-91a5-45ea-bb3e-65ba41229ffd",
   "metadata": {},
   "source": [
    "$\\bar{x}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "deccc0ae-3a65-410d-9cc0-a5768bb10e01",
   "metadata": {},
   "source": [
    "$\\dot{x}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "555f417a-336b-47fa-a38c-11b423ee7f66",
   "metadata": {},
   "source": [
    "$\\tilde{x}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e9d0468e-8519-45a1-88cf-eeb8b2e87957",
   "metadata": {},
   "source": [
    "$x_i$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "30d73eb0-8270-4223-8f9f-a39b496b0f85",
   "metadata": {},
   "source": [
    "$x^i$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2f16e2e9-4402-4dbb-bd86-44c7995a5069",
   "metadata": {},
   "source": [
    "$\\ddot{x}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b058b2a1-b629-4a1f-93d4-aec19eb8cd13",
   "metadata": {},
   "source": [
    "$x^*$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "071bc307-3f69-4c8d-b535-8f989442d0dc",
   "metadata": {},
   "source": [
    "$x\\dagger$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "038dabec-19e0-4f5c-9fb8-dd1396894eb0",
   "metadata": {},
   "source": [
    "$x\\ddagger$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ca822bf4-5e84-485f-b0e2-a21bc37cd215",
   "metadata": {},
   "source": [
    "${\\color{red}x}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "69fcb366-d905-4c7f-9b7c-7f40f733a8ff",
   "metadata": {},
   "source": [
    "$x^{2}-y^{2} = \\left(x+y\\right)\\left(x-y\\right)$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7a8d2c48-c393-4fdb-806d-c7005c21d89e",
   "metadata": {},
   "source": [
    "$a_{n}x^{n}+a_{n-1}x^{n-1}+\\dotsb + a_{2}x^{2} + a_{1}x + a_{0}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d493c36b-caec-4335-b9b6-e3a3966bd9e6",
   "metadata": {},
   "source": [
    "$\\sum_{k=0}^{n}a_{k}x^{k}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9144c607-14e2-454e-8f1e-2c9e866f6ae0",
   "metadata": {},
   "source": [
    "$ ax^{2}+bx+c=0\\ (a\\neq 0) $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1cf1a8d8-dd91-42ff-a8a6-69da3db07113",
   "metadata": {},
   "source": [
    "${\\sqrt[{n}]{a^{m}}}=(a^{m})^{1/n}=a^{m/n}=(a^{1/n})^{m}=({\\sqrt[{n}]{a}})^{m}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6649736c-e19e-46be-9f3a-f5bd5c8d1e58",
   "metadata": {},
   "source": [
    "$\\left({\\sqrt {1-x^{2}}}\\right)^{2}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5c237bf8-993f-43a8-9bec-47cc4994f228",
   "metadata": {},
   "source": [
    "$\\frac {1}{x+1}+{\\frac {1}{x-1}}={\\frac {2x}{x^{2}-1}}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ec48ab12-c5d3-43df-a4a4-087ce324c8ba",
   "metadata": {},
   "source": [
    "$x_{1,2}={\\frac {-b\\pm {\\sqrt {b^{2}-4ac}}}{2a}}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c84f13bf-ef96-42f1-b962-7980808fa66f",
   "metadata": {},
   "source": [
    "$f(x)=ax^{2}+bx+c~~{\\text{ with }}~~a,b,c\\in \\mathbb {R} ,\\ a\\neq 0$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "49913f0e-e68c-4dd6-97df-4d4090646068",
   "metadata": {},
   "source": [
    "$f(x_1, x_2) = x_1^2 + x_2^2 + 2x_1x_2$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0c003f5f-6d85-4882-826f-206a440391c3",
   "metadata": {},
   "source": [
    "$\\log_{b}(xy)=\\log_{b}x+\\log_{b}y$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e7a9afc4-b344-4736-b35c-c73af9658905",
   "metadata": {},
   "source": [
    "$\\ln(xy)=\\ln x+\\ln y{\\text{  for  }} x>0 {\\text{  and  }} y>0$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5c157099-9e92-4bc2-ae4d-fd3e4cb92db2",
   "metadata": {},
   "source": [
    "$f(x)=a\\exp \\left(-{\\frac {(x-b)^{2}}{2c^{2}}}\\right)$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "924451d7-ae72-4f22-9946-20b6107ba507",
   "metadata": {},
   "source": [
    "$\\sin ^{2}\\theta +\\cos ^{2}\\theta =1$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f5c7fe58-e3bc-4fcf-9fe1-e55da75b5b17",
   "metadata": {},
   "source": [
    "$\\sin 2\\theta =2\\sin \\theta \\cos \\theta$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f5222a4c-fb02-49c0-93be-31e819ac7027",
   "metadata": {},
   "source": [
    "$\\sin(\\alpha \\pm \\beta )=\\sin \\alpha \\cos \\beta \\pm \\cos \\alpha \\sin \\beta$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "55eefe9c-71d9-44af-977d-91605fa0a1ec",
   "metadata": {},
   "source": [
    "$\\tan(\\alpha \\pm \\beta )=\\frac {\\tan \\alpha \\pm \\tan \\beta }{1\\mp \\tan \\alpha \\tan \\beta }$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5b0e21e7-0e17-49c9-ba9b-2159ef6f5b18",
   "metadata": {},
   "source": [
    "$\\exp(x)=\\sum _{k=0}^{\\infty }{\\frac {x^{k}}{k!}}=1+x+{\\frac {x^{2}}{2}}+{\\frac {x^{3}}{6}}+{\\frac {x^{4}}{24}}+\\cdots $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "46477670-11b1-4316-af4b-f5ae6e1899cf",
   "metadata": {},
   "source": [
    "$ \\left(\\sum _{i=0}^{n}a_{i}\\right)\\left(\\sum _{j=0}^{n}b_{j}\\right)=\\sum _{i=0}^{n}\\sum _{j=0}^{n}a_{i}b_{j}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "00e14b20-9a8d-4643-8a6e-55b611589fef",
   "metadata": {},
   "source": [
    "$\\exp(x) =\\lim _{n\\to \\infty }\\left(1+{\\frac {x}{n}}\\right)^{n}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bba58654-9504-4523-8768-21e59f56dafd",
   "metadata": {},
   "source": [
    "$\\frac {\\mathrm{d}}{\\mathrm{d}x} \\exp(f(x)) =f'(x) \\exp(f(x))$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c4d0a35-9fee-42e1-83fe-0f89a75a57f5",
   "metadata": {},
   "source": [
    "$\\int_{a}^{b}f(x) \\mathrm {d} x$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7e87fbca-2363-4e4b-be09-8f17026a60f3",
   "metadata": {},
   "source": [
    "$\\int _{-\\infty }^{\\infty }\\exp(-x^{2})\\mathrm{d}x={\\sqrt {\\mathrm{\\pi} }}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6dfd2a51-1add-4783-9de6-7dff27456536",
   "metadata": {},
   "source": [
    "$\\int _{-\\infty }^{\\infty }\\int _{-\\infty }^{\\infty } \\exp \\left({-\\left(x^{2}+y^{2}\\right)} \\right) {\\mathrm{d}x} {\\mathrm{d}y} = \\pi$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d76ec949-c9ea-4e68-a206-71144bd84c93",
   "metadata": {},
   "source": [
    "$\\frac {\\partial ^{2}f}{\\partial x^{2}}=f''_{xx}=\\partial _{xx}f=\\partial _{x}^{2}f$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "02abc1b4-23ef-4be0-b170-9a6208e240a8",
   "metadata": {},
   "source": [
    "${\\frac {\\partial ^{2}f}{\\partial y \\partial x}}={\\frac {\\partial }{\\partial y}}\\left({\\frac {\\partial f}{\\partial x}}\\right)=f''_{xy}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a037ba76-b52c-4a54-9210-0ba7f5898873",
   "metadata": {},
   "source": [
    "$\\mathbf {a} = {\\begin{bmatrix} a_{1} \\\\ a_{2} \\\\ a_{3} \\end{bmatrix}} = [a_{1}\\ a_{2}\\ a_{3}]^{\\operatorname {T} }$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1ec18b5e-0798-4ae0-b0c7-58b070458da4",
   "metadata": {},
   "source": [
    "$\\left\\|\\mathbf {a} \\right\\|=\\sqrt {a_{1}^{2}+a_{2}^{2}+a_{3}^{2}}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "002a608b-29c2-41d2-96f8-3fff09bfa74c",
   "metadata": {},
   "source": [
    "$\\mathbf {a} \\cdot \\mathbf {b} = a_{1}b_{1} + a_{2}b_{2} + a_{3}b_{3}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d74d2b9f-8dd6-43e9-9578-4b09439cde9c",
   "metadata": {},
   "source": [
    "$\\mathbf {a} \\cdot \\mathbf {b} =\\left\\|\\mathbf {a} \\right\\|\\left\\|\\mathbf {b} \\right\\|\\cos \\theta $"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5d9885de-8b7b-45af-80ec-e0ec60f101a3",
   "metadata": {},
   "source": [
    "$\\|\\mathbf {x} \\|_{p}=\\left(\\sum _{i=1}^{n}\\left|x_{i}\\right|^{p}\\right)^{1/p}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4be2270c-dcbf-4ac6-adc8-187df8e0eb73",
   "metadata": {},
   "source": [
    "$\\mathbf {A} = {\\begin{bmatrix} 1 & 2\\\\ 3 & 4 \\\\ 5 & 6 \\end{bmatrix}}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b149d0f-e62d-4628-a6c0-7b9d14fa21c6",
   "metadata": {},
   "source": [
    "$\\mathbf {A} ={\\begin{bmatrix}a_{11}&a_{12}&\\cdots &a_{1n}\\\\a_{21}&a_{22}&\\cdots &a_{2n}\\\\\\vdots &\\vdots &\\ddots &\\vdots \\\\a_{m1}&a_{m2}&\\cdots &a_{mn}\\end{bmatrix}}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bd470a3b-360a-4f56-8a04-d30e8cd955fd",
   "metadata": {},
   "source": [
    "$\\left(\\mathbf {A} +\\mathbf {B} \\right)^{\\operatorname {T} }=\\mathbf {A} ^{\\operatorname {T} }+\\mathbf {B} ^{\\operatorname {T} }$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f415746f-eee1-4598-a68e-1eef9494e003",
   "metadata": {},
   "source": [
    "$\\left(\\mathbf {AB} \\right)^{\\operatorname {T} }=\\mathbf {B} ^{\\operatorname {T} }\\mathbf {A} ^{\\operatorname {T} }$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "abd7ed45-66a6-4eda-84ca-8a79e3fca450",
   "metadata": {},
   "source": [
    "$ \\left(\\mathbf {A} ^{\\operatorname {T} }\\right)^{-1}=\\left(\\mathbf {A} ^{-1}\\right)^{\\operatorname {T} }$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8bcb4845-1f2e-4372-9315-7c913337402f",
   "metadata": {},
   "source": [
    "$\\mathbf {u} \\otimes \\mathbf {v} = \\mathbf {u} \\mathbf {v} ^ {\\operatorname {T}} = {\\begin{bmatrix}u_{1} \\\\ u_{2} \\\\ u_{3} \\\\ u_{4} \\end{bmatrix}} {\\begin{bmatrix} v_{1}&v_{2}&v_{3} \\end{bmatrix}} = {\\begin{bmatrix} u_{1}v_{1} & u_{1}v_{2} & u_{1}v_{3} \\\\ u_{2}v_{1} & u_{2}v_{2} & u_{2}v_{3} \\\\ u_{3}v_{1} & u_{3}v_{2} & u_{3}v_{3} \\\\ u_{4}v_{1} & u_{4}v_{2} & u_{4}v_{3} \\end{bmatrix}}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "95193bcc-cfef-4d35-81a4-36944d0bd78c",
   "metadata": {},
   "source": [
    "$\\det {\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}} = ad-bc$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "411a967a-a259-4d6f-ab9e-ed72d6d448e0",
   "metadata": {},
   "source": [
    "$\\Pr(A\\vert B)={\\frac {\\Pr(B\\vert A)\\Pr(A)}{\\Pr(B)}}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7c7e14aa-202f-4e4a-9705-2990a4a487ca",
   "metadata": {},
   "source": [
    "$ f_{X\\vert Y=y}(x)={\\frac {f_{X,Y}(x,y)}{f_{Y}(y)}}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6a1f04e0-f830-4738-b85f-a7c8faea3896",
   "metadata": {},
   "source": [
    "$\\operatorname {var} (X) = \\operatorname {E} \\left[X^{2}\\right]-\\operatorname {E} [X]^{2}$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9026c67a-6700-4039-9d0b-b82c65b6c681",
   "metadata": {},
   "source": [
    "$\\operatorname {var} (aX+bY)=a^{2}\\operatorname {var} (X) + b^{2}\\operatorname {var} (Y) + 2ab \\operatorname {cov} (X,Y)$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4cee5f78-b80c-4021-a1e0-8fc71d379f92",
   "metadata": {},
   "source": [
    "$\\operatorname {E} [X]=\\int _{-\\infty }^{\\infty }xf_{X}(x) \\operatorname {d}x$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "38144863-f0a2-4e4c-a9a6-f545d45133a1",
   "metadata": {},
   "source": [
    "$ X\\sim N(\\mu ,\\sigma ^{2})$"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0578bbbd-4498-4122-b49a-0fb5e272050c",
   "metadata": {},
   "source": [
    "$\\frac {\\exp \\left(-{\\frac {1}{2}}\\left({\\mathbf {x} }-{\\boldsymbol {\\mu }}\\right)^{\\mathrm {T} }{\\boldsymbol {\\Sigma }}^{-1}\\left({\\mathbf {x} }-{\\boldsymbol {\\mu }}\\right)\\right)}{\\sqrt {(2\\pi )^{k}|{\\boldsymbol {\\Sigma }}|}}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f94482d1-b33a-4ede-af00-3a1101fdd78d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d30c8d7c-be54-41ce-9129-8c623fb18d1e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
